<?php

namespace App\Http\Resources\Kms\App;

use Illuminate\Http\Resources\Json\JsonResource;

class VersionListResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            "id"                   => $this->id,
            "version"              => $this->version,
            "versionChangeContent" => $this->versionChangeContent,
            "packageUrl"           => $this->packageUrl,
            "packagingToolVersion" => $this->packagingToolVersion,
            "couldUpdate"          => !(bool)$this->versionReleaseHistoryRel->count(),
            'createdAt'            => date('Y-m-d H:i:s', $this->createdAt),
        ]; // TODO=> Change the autogenerated stub
    }
}
